home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 71
/
MOBICLIC 71.ISO
/
mac
/
DATA
/
COMMUN
/
temp0001
/
00006_Script_gestion du son
< prev
next >
Wrap
Text File
|
2004-12-05
|
4KB
|
136 lines
-- gestion du son
global dernierSon,gL_Zap,volumeOn,menusActifs,ouvreVolume, chemin, gFlag_soustitrage
-- dernierSon : nom du dernier son jouΘ
-- gL_Zap[16] : liste α 8 termes contenant le niveau sonore de chaque piste son
-----------------------------------------------
on joueSon nom, n
global gL_Zap
tampon = nom
-- lecture d'un son
global glocal_Folder
-- if voidP(glocal_Folder) then exit
if the paramCount = 1 then
n = 3
end if
gL_Zap[30] = n -- on enregistre le n░ de piste son lancΘ (pour la fenΩtre commentaire)
if offset(":", nom) = 0 then
case(the movieName.char[1..5] = "RECRE") of
1:
nom ="SONS_ARRIBA:"& nom
0:
nom ="SONS_"& glocal_Folder&":"& nom
end case
end if
dernierSon = nom
--
put the pathName & nomDos(nom) & ".aif" into temp
put " Son jouΘ : " & dernierSon
sound playFile n, temp
-- rΘglage du niveau des autres canaux
repeat with i=1 to 8
if i<>n and gL_Zap[16][i]>110 then
sound(i).volume = 50
end if
end repeat
---------------------------------------lancement du sous-titrage pour les sourds------------
if the activeWindow = the Stage then gere_soustitrage(tampon)
--------------------------------------------------------------------------------------------
end joueSon
---------------------------------------------
on lowjoueSon nom, n
global glocal_Folder
if voidP(glocal_Folder) then exit
if the paramCount = 1 then
n = 3
end if
if voidP(gL_Zap[16])=1 then Init_gL_Zap[16]
if not(nom contains "SONS") then
if offset(":", nom) = 0 then
case(the movieName.char[1..3] = "LAN") of
1:
nom ="SONS:"& nom
0:
nom ="SONS_"& glocal_Folder&":"& nom
end case
end if
end if
dernierSon = nom
--
put the pathName & nomDos(nom) & ".aif" into temp
put " Son jouΘ : " & dernierSon
sound(n).volume = zvolume(n)
sound playFile n, temp
---------------------------------------lancement du sous-titrage pour les sourds------------
if gFlag_soustitrage = 1 then gere_soustitrage(nom)
end
--------------------------------------------------------------------------------------------
on Init_niveauxsons
global gL_Zap
-- gL_Zap[16]=[]
-- repeat with i = 1 to 8
-- gL_Zap[16].add(255)
-- end repeat
gL_Zap[16] = [150,200,255,255,255,255,255,75,6]
end
-----------------
on niveauSon
global gL_Zap
-- rΘglage du volume des pistes son
if voidP(gL_Zap) then
Init_niveauxsons()
end if
repeat with i=1 to 8
sound(i).volume = gL_Zap[16][i]
end repeat
end
----------------------------------------
on attendreSon p
-- attendre la fin d'un son
set T = 1.0/the frameTempo
repeat while soundBusy(p)
updateStage
temporise(T)
end repeat
end
-----------------------------------------
on coupeSon
-- dΘsactivation des pistes audio
repeat with i=1 to the paramCount
if value(param(i))<>0 then
puppetSound (param(i)),0
else
listeSons param(i)
end if
end repeat
end coupeSon
-------------------------------------------
on listeSons chaine
n=offset(">", chaine)
n1=value(char 1 to n-1 of chaine)
n2=value(char n+1 to length(chaine) of chaine)
repeat with j=n1 to n2
puppetSound j,0
end repeat
end listeSons
-----------------------------------
on calcul_nivson No
global gL_Zap
NewNiv = [0,50,100,150,200,255][No]
OldNiv = [0,50,100,150,200,255][gL_Zap[16][9]]
L_NewVolumes = []
repeat with i = 1 to 8
case(gL_Zap[16][i]) of
0:
gL_Zap[16][i] = NewNiv
otherwise:
gL_Zap[16][i] = integer((float(gL_Zap[16][i])*NewNiv)/OldNiv)
end case
end repeat
gL_Zap[16][9] = No
niveauson()
end
--------------------